<?php

// +----------------------------------------------------------------------
// |用户model
// +----------------------------------------------------------------------
namespace app\common\Model;

use think\facade\Db;
use think\Model;

class UserModel extends Model{

    // 表名
    protected $name = 'users';
    // 表主键
    protected $pk = 'id';


     // 获取所有有效用户数据
     public function getActiveStatus()
     {
         $data=$this->where('status', 1)->column('id,nickname','id');
         return $data;
     }

     // 获取所有有效用户数据
     public function getActivelist()
     {
         $data=$this->column('id,nickname','id');
         return $data;
     }

       // 获取所有有效用户数据
     public function getuserlist($group_id=[1])    
     { 
         $data=$this->alias('a')->join('auth_group_access aga','a.id = aga.uid')->wherein('aga.group_id',$group_id)->column('id,nickname','id');       
         return $data;
     }
}
